package com.gxa.modules.mapper;

import com.gxa.modules.pojo.R_Role;
import com.gxa.modules.pojo.R_User;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotNull;
import java.util.List; /**
 * @Author: wangyifan
 * @Date: 2021/12/28 10:44
 * @Description: $end$
 * @Version: V1.0
 */
public interface ManageMapper {
    int addRole(@Param("roleName") String roleName);

    int addRole2(@Param("roleName")String roleName,@Param("power") Integer power);


    int addUser(R_User user);

    int addUserRole(@Param("username")String username,@Param("role_id") long role_id);

    int addAc_num(long role_id);

    List<R_Role> queryRole(@Param("currentPage")Integer currentPage, @Param("pageSize")Integer pageSize,@Param("string")String string);

    Integer count(@Param("tableName")String tableName);

    List<R_User> queryUser(@Param("currentPage")Integer currentPage,  @Param("pageSize")Integer pageSize, @Param("string")String string);

    int updateRole(@Param("roleId")Integer roleId, @NotNull @Param("roleName")String roleName);

    int deleteRoleMenu(@Param("roleId")Integer roleId);

    int addRoleMnue(@Param("roleId")Integer roleId, @Param("power")int power);

    int deleteRole(@Param("roleId")@NotNull Integer roleId);

    int updateUser(R_User user);

    int updateUserRole(@Param("user_id")Long user_id,@Param("role_id") Long role_id);

    int deleteUser(@Param("user_id")@NotNull Long userId);

    int deleteUserRole(@Param("user_id")@NotNull Long userId);
}
